package com.mldong.modules.sys.enums;

import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonValue;
import com.mldong.annotation.DictEnum;
import com.mldong.base.CodedEnum;

@DictEnum(key = "sys_task_execution_queue_state", name = "历史归档队列状态")
public enum TaskExecutionHistoryStateEnum implements CodedEnum {
    SUCCESS(2, "成功"),
    CANCELLED(3, "已取消"),
    FAILED(9, "失败-终态");
    ;
    private Integer code;
    private String message;

    @JsonCreator
    public static TaskExecutionHistoryStateEnum forValue(Object value) {
        return CodedEnum.codeOf(TaskExecutionHistoryStateEnum.class, value).get();
    }

    TaskExecutionHistoryStateEnum(Integer code, String message) {
        this.code = code;
        this.message = message;
    }
    @JsonValue
    @Override
    public Integer getCode() {
        return this.code;
    }

    @Override
    public String getMessage() {
        return this.message;
    }
}
